 /// @file ExchangePMINote.h
 /// @brief ExchangePMINote 
 /// @copyright Copyright (c) 2025  Hefei Jiushao Intelligent Technology Co., Ltd. All rights reserved.
 /// @createtime 2025-04-07

#ifndef EXCHANGECOREPMINOTE_H
#define EXCHANGECOREPMINOTE_H
#include "ExchangePMIBase.h"
#include <vector>

namespace  AMCAX::Exchange::Core::PMI {

    /// Enum for font type of text annotation.
    enum PMIFont
    {
        Simplex,
        Din,
        Military,
        ISO,
        Lightline,
        Century,
        IGES_1001,
        IGES_1002,
        IGES_1003
    };

    ENUM_TO_STRING_CASE_ALL(
        PMIFont,
        ENUM_CASE(PMIFont,Simplex)
        ENUM_CASE(PMIFont,Din)
        ENUM_CASE(PMIFont,Military)
        ENUM_CASE(PMIFont,ISO)
        ENUM_CASE(PMIFont,Lightline)
        ENUM_CASE(PMIFont,Century)
        ENUM_CASE(PMIFont,IGES_1001)
        ENUM_CASE(PMIFont,IGES_1002)
        ENUM_CASE(PMIFont,IGES_1003)
    )

    class ExchangeNote : public ExchangePMIAnnotation
    {
    public:
        ~ExchangeNote() = default;

        struct Text{
            /// The string value of the label associated with this text.
            std::string label ;
            /// The name of the font associated with this text.
            std::string fontName ;
            /// 
            PMIFont fontType ;
            /// Denotes whether the text note has a fixed pitch.
            bool fixedPitch ;
            /// The height of the text note.
            float height ;

            /// Denotes whether the text note is bold.
            bool bold ;

            /// Denotes whether the text note is italic.
            bool italic ;
            /// Denotes whether the text note is underlined.
            bool underline ;

            /// Denotes whether the text note has strike through.
            bool strikeThrough ;

            /// Denotes whether the text note has an over line.
            bool overline ;

            /// The ratio of the text note.
            float ratio ;

            /// The slant of the text note.
            float slant ;

            /// The color of the text note.
            double rgbaColor[4] ;
        } ;

        /// @brief Obtain the type of this annotation.
        /// @return 
        ///		Type: PMIAnnotationType::Note.
        virtual PMIAnnotationType GetType() const 
        {
            return PMIAnnotationType::Note;
        } 

        /// @brief Set the flag of the note
        /// @param[in] isFlagNote: if this field is true, it means this note is a Flag Note.

        void SetIsFlagNote(bool isFlagNote) {
            this->isFlagNote = isFlagNote ;
        } ;

        /// @bref Set the flag of the note
        /// @param[in] isNOA: This note is a Note Object Atttribute(NOA).
        void SetIsNOA(bool isNOA) {
            this->isNOA = isNOA ;
        } ;

        /// @brief Add text to the note
        /// @param[in] text: The text to be added to the note.
        /// @return NONE        
        void AddText(const Text &text) {
            noteTexts.push_back(text) ;
        } ;

        std::string ToString() override ;
    private:

        std::string noteType ;
        std::vector<Text>  noteTexts ;
        /// if this field is true, it means this note is a Flag Note.
        bool isFlagNote ;
        /// This note is a Note Object Atttribute(NOA).
        bool isNOA ;
    };
}

#endif